3.1.41 \(\int \csc ^4(e+f x) (a+b \tan ^2(e+f x)) \, dx\) [41]

Optimal. Leaf size=42 \[ -\frac {(a+b) \cot (e+f x)}{f}-\frac {a \cot ^3(e+f x)}{3 f}+\frac {b \tan (e+f x)}{f} \]

[Out]

-(a+b)*cot(f*x+e)/f-1/3*a*cot(f*x+e)^3/f+b*tan(f*x+e)/f

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3744, 459} \begin {gather*} -\frac {(a+b) \cot (e+f x)}{f}-\frac {a \cot ^3(e+f x)}{3 f}+\frac {b \tan (e+f x)}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^4*(a + b*Tan[e + f*x]^2),x]

[Out]

-(((a + b)*Cot[e + f*x])/f) - (a*Cot[e + f*x]^3)/(3*f) + (b*Tan[e + f*x])/f

Rule 459

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[ExpandI
ntegrand[(e*x)^m*(a + b*x^n)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && NeQ[b*c - a*d, 0] &
& IGtQ[p, 0] && IGtQ[q, 0]

Rule 3744

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff^(m + 1)/f), Subst[Int[x^m*((a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2)
^(m/2 + 1)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \csc ^4(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac {\text {Subst}\left (\int \frac {\left (1+x^2\right ) \left (a+b x^2\right )}{x^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\text {Subst}\left (\int \left (b+\frac {a}{x^4}+\frac {a+b}{x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {(a+b) \cot (e+f x)}{f}-\frac {a \cot ^3(e+f x)}{3 f}+\frac {b \tan (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 60, normalized size = 1.43 \begin {gather*} -\frac {2 a \cot (e+f x)}{3 f}-\frac {b \cot (e+f x)}{f}-\frac {a \cot (e+f x) \csc ^2(e+f x)}{3 f}+\frac {b \tan (e+f x)}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^4*(a + b*Tan[e + f*x]^2),x]

[Out]

(-2*a*Cot[e + f*x])/(3*f) - (b*Cot[e + f*x])/f - (a*Cot[e + f*x]*Csc[e + f*x]^2)/(3*f) + (b*Tan[e + f*x])/f

________________________________________________________________________________________

Maple [A]
time = 0.12, size = 54, normalized size = 1.29

method result size
derivativedivides \(\frac {b \left (\frac {1}{\sin \left (f x +e \right ) \cos \left (f x +e \right )}-2 \cot \left (f x +e \right )\right )+a \left (-\frac {2}{3}-\frac {\left (\csc ^{2}\left (f x +e \right )\right )}{3}\right ) \cot \left (f x +e \right )}{f}\) \(54\)
default \(\frac {b \left (\frac {1}{\sin \left (f x +e \right ) \cos \left (f x +e \right )}-2 \cot \left (f x +e \right )\right )+a \left (-\frac {2}{3}-\frac {\left (\csc ^{2}\left (f x +e \right )\right )}{3}\right ) \cot \left (f x +e \right )}{f}\) \(54\)
risch \(\frac {4 i \left (3 a \,{\mathrm e}^{4 i \left (f x +e \right )}-3 b \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}+6 b \,{\mathrm e}^{2 i \left (f x +e \right )}-a -3 b \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{3} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}\) \(88\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^4*(a+b*tan(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/f*(b*(1/sin(f*x+e)/cos(f*x+e)-2*cot(f*x+e))+a*(-2/3-1/3*csc(f*x+e)^2)*cot(f*x+e))

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 43, normalized size = 1.02 \begin {gather*} \frac {3 \, b \tan \left (f x + e\right ) - \frac {3 \, {\left (a + b\right )} \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{3}}}{3 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/3*(3*b*tan(f*x + e) - (3*(a + b)*tan(f*x + e)^2 + a)/tan(f*x + e)^3)/f

________________________________________________________________________________________

Fricas [A]
time = 1.44, size = 71, normalized size = 1.69 \begin {gather*} -\frac {2 \, {\left (a + 3 \, b\right )} \cos \left (f x + e\right )^{4} - 3 \, {\left (a + 3 \, b\right )} \cos \left (f x + e\right )^{2} + 3 \, b}{3 \, {\left (f \cos \left (f x + e\right )^{3} - f \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-1/3*(2*(a + 3*b)*cos(f*x + e)^4 - 3*(a + 3*b)*cos(f*x + e)^2 + 3*b)/((f*cos(f*x + e)^3 - f*cos(f*x + e))*sin(
f*x + e))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \csc ^{4}{\left (e + f x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**4*(a+b*tan(f*x+e)**2),x)

[Out]

Integral((a + b*tan(e + f*x)**2)*csc(e + f*x)**4, x)

________________________________________________________________________________________

Giac [A]
time = 0.60, size = 53, normalized size = 1.26 \begin {gather*} \frac {3 \, b \tan \left (f x + e\right ) - \frac {3 \, a \tan \left (f x + e\right )^{2} + 3 \, b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{3}}}{3 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^4*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/3*(3*b*tan(f*x + e) - (3*a*tan(f*x + e)^2 + 3*b*tan(f*x + e)^2 + a)/tan(f*x + e)^3)/f

________________________________________________________________________________________

Mupad [B]
time = 11.49, size = 41, normalized size = 0.98 \begin {gather*} \frac {b\,\mathrm {tan}\left (e+f\,x\right )}{f}-\frac {\left (a+b\right )\,{\mathrm {tan}\left (e+f\,x\right )}^2+\frac {a}{3}}{f\,{\mathrm {tan}\left (e+f\,x\right )}^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(e + f*x)^2)/sin(e + f*x)^4,x)

[Out]

(b*tan(e + f*x))/f - (a/3 + tan(e + f*x)^2*(a + b))/(f*tan(e + f*x)^3)

________________________________________________________________________________________